/// \file RendererDX9.h
/// \date 2012-12-08
/// \brief concrete class that offers the rendering and graphics device related functionality in DX9

#ifndef _TORUSPRORENDERING_RENDER_RENDERERDX9_H__
#define _TORUSPRORENDERING_RENDER_RENDERERDX9_H__

// DirectX9
#include <d3d9.h>
#include <D3dx9core.h>

#include <Render/Include/Renderer.h>
#include <Render/Include/IWinWindow.h>

namespace Render
{

/// \brief concrete class that offers the rendering and graphics device related functionality in DX9
class RendererDX9 : public Renderer
{
public:
    // ========== LIFECYCLE ========== //
    
    /// \brief Constructor
    RendererDX9(IWinWindow* window);

    /// \brief Destructor
    virtual ~RendererDX9();

    // ========== OVERLODED OPERATORS ========== //

    // ========== METHODS ========== //
        
    /// \brief concrete method to render a torus
    virtual void renderTorus(AppModel::Torus* torus);
    
    /// \brief concrete method to create a texture
    virtual Texture* createTexture(const char* file);

    /// \brief concrete method to create a mesh
    virtual Mesh* createMesh(VertexData* vertex_data, const unsigned int &vertex_count, IndexData* index_data, const unsigned int &index_count);


    // ========== GETTERS ========== //

    // ========== SETTERS ========== //

    // ========== INQUIRY ========== //

private:
    // ========== INTERNAL METHODS ========== //
    std::wstring convertToWideString(const std::string &cadena);
      
    // ========== ATTRIBUTES ========== //
    
    /// \brief directX9 device pointer
    LPDIRECT3DDEVICE9 p_device;

    /// \brief directX9 effect framework object
    ID3DXEffect* effect;
    
};
};
#endif // _TORUSPRORENDERING_RENDER_RENDERERDX9_H__
